package com.example.clock.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.clock.entity.Attend;
import com.example.clock.entity.AttendVo;

import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public interface AttendService extends IService<Attend> {
    /**
     * 打卡
     * @param userName 姓名
     * @param time 时间
     */
    String clock(String userName, LocalDateTime time);

    /**
     * 获取打卡列表
     * @param userName
     * @param sTime
     * @param eTime
     * @return
     */
    AttendVo getClockList(String userName, LocalDate sTime, LocalDate eTime, Integer page, Integer limit) throws ParseException;

    /**
     * 获取本周打卡列表
     * @param userName
     * @return thisWeekMondayLocalDateTime 周一开始时间
     */
    AttendVo getThisWeekClockList(String userName, LocalDate thisWeekMondayLocalDate);

    /**
     * 获取本月打卡列表
     * @param userName
     * @return thisWeekMondayLocalDateTime 周一开始时间
     */
    AttendVo getThisMonthClockList(String userName, LocalDate sTime, LocalDate eTime) throws ParseException;

    /**
     * 导出记录
     * @param response
     */
    void exportExcel(HttpServletResponse response,String userName);

    /**
     * 修改打卡记录
     * @param attend
     * @return
     */
    int editClock(Attend attend);

    /**
     * 删除打卡记录
     * @param ids
     */
    void deleteClock(List<Integer> ids);

    /**
     * 获取预计下班时间
     */
    List<String> getEstimatedTimeOfDismissal(String userName);
}
